<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="../common/TreeListUIHead.jsp"></jsp:include>
<title>权限树</title>
</head>
<script type="text/javascript">
	$.post(getPath()+"/permission/permissionItem/permissionAll",{},function(data){
		$.fn.zTree.init($("#allTree"), {
			view:{
				selectedMulti:$tree_view_selectedMulti
			},
			data:{
				simpleData:{
					enable: true,
					idKey: "id",
					pIdKey: "pid",
					rootPId: null
				}
			},
			check: {
				enable: true,
				chkStyle: "checkbox",
				chkboxType: { "Y": "ps", "N": "ps" }
			}
		},data);
	},'json');
	function okSelect(){
		var treeObj = $.fn.zTree.getZTreeObj("allTree");
		var nodes = treeObj.getCheckedNodes(true);
		if(nodes && nodes.length){
			var itemNodes = [];
			for(var i = 0; i < nodes.length; i++){
				if(nodes[i].type=='ITEM'){
					itemNodes[itemNodes.length] = nodes[i];
				}
			}
			if(itemNodes.length==0){
				art.dialog.tips('没有选择数据');
			}else{
				artDialog.open.origin[art.dialog.data("returnFunName")].call(null, itemNodes);
				art.dialog.close();
			}
		}
	}
</script>
<body style="padding:1px 3px 1px 3px;overflow:hidden">
	<div id="main">
		<div position="center">
			<ul id="allTree" class="ztree"></ul>
		</div>
    </div>
</body>
</html>